<template>
<!-- 预警 -->
  <view class='waming_page'>
    <view class='head'>
        <screen :headTab_index='-2' :head_height='head_height'></screen>
    </view>

    <list2></list2>

    <!-- 悬浮按钮 -->
    <!-- <fab type='notice' :head_height='head_height'></fab> -->

    <!-- 长按文章的扩展功能 -->
    <article-extend></article-extend>
  </view>
</template>

<script>

  import list2 from '@/pages/index/components/list2.vue'
  import fab from '@/pages/common/fab.vue'

  export default {
    components: {
      list2,
      fab,
    },
    data() {
      return {
        head_height: 0,
        allLevel_status: false
      }
    },
    onReady() {
      let webView = this.$mp.page.$getAppWebview();
      
      console.log(webView)
        webView.setTitleNViewButtonBadge({  
            index: 0,  
            text: 10,  
        });

        this.computeHeadHeight();
    },
    methods: {
      // 点击全部级别
      clickAllLevel() {
        if(this.allLevel_status) {
          this.allLevel_status = false;
          this.$refs.selece_popup.hidden();
        }else {
          this.allLevel_status = true;
          this.$refs.selece_popup.show();
        }
      },
      // 计算页面头部高度
      async computeHeadHeight() {
        this.head_height = await this.$getDomInfo(".head","height");
        // #ifdef  H5
            this.head_height = this.head_height + uni.upx2px(88);
        // #endif
      },
    }
  }
</script>

<style lang="scss" scoped>
.waming_page {
  width: 100%;
  padding-top: 100upx;
  box-sizing: border-box;
  .head {
    top: 0;
    /*  #ifdef  H5  */
    top: 88upx;
    /*  #endif  */
    .screen1 {
      .left {
        width: 75%;
        .select_item {
          >view {
            width: 98%;
          }
        }
      }
      .icon_box {
        width: 25%;
      }
    }
  }
}
</style>